package com.springbootbase.springbootproject.mapper;

import com.springbootbase.springbootproject.pojo.Evaluation;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface evaluationMapper {

    @Insert("INSERT INTO evaluation(username,college,school,comment,score,created_at) " +
            "VALUES (#{username},#{college},#{school},#{comment},#{score},#{createdAt})")
    void addComment(Evaluation evaluation);


    @Select("SELECT * FROM evaluation WHERE username=#{username}")
    ArrayList<Evaluation> getList(String username);
}
